<!DOCTYPE html>
<html lang='en'>

<head>
  <title>3D Slicer Web Server</title>
  <meta content='width=device-width, initial-scale=1' name='viewport'>
  <link href='./stylesheets/application.css' rel='stylesheet'>
</head>

<body>
  <div id='slicer_header'>
    <img src='./images/3DSlicer-DesktopIcon.png'>
    <span class='text'>
      <span class='gray'>3D Slicer</span> Web Server
    </span>
  </div>

  <h2>Data Management</h2>

  <ul>
    <li>
      <h3>Load sample data</h3>
      <p>Load MRHead sample data set</p>
      <a href='./slicer/sampledata?name=MRHead'>slicer/sampledata?name=MRHead</a><br>
    </li>

    <li>
      <h3>Download volume</h3>
      <p>Download a dataset in nrrd format.</p>
      <a href='./slicer/volume'>slicer/volume</a><br>
    </li>
  </ul>

  <h2>Viewers</h2>

  <ul>
    <li>
      <h3>Main Window</h3>
      <p>Set displayed GUI elements and and viewers layout in the application main window.</p>
      <a href='./slicer/gui?contents=viewers&viewersLayout=FourUp'>slicer/gui?contents=viewers&viewersLayout=FourUp</a><br>
      <a href='./slicer/gui?contents=full&viewersLayout=OneUp3D'>slicer/gui?contents=full&viewersLayout=OneUp3D</a><br>
      <a href='./slicer/gui?contents=full&viewersLayout=FourUp'>slicer/gui?contents=full&viewersLayout=FourUp</a><br>
    </li>
    <li>
      <h3>Screenshot</h3>
      <p>Displays screenshot of the application main main window.</p>
      <a href='./slicer/screenshot'>slicer/screenshot</a><br>
    </li>
    <li>
      <h3>Slice Views</h3>
      <p>Displays the current contents of a Slicer slice view window.</p>
      <a href='./slicer/slice'>slicer/slice</a><br>
      <a href='./slicer/slice?orientation=sagittal'>slicer/slice?orientation=sagittal</a><br>
      <a href='./slicer/slice?orientation=axial&scrollTo=.3'>slicer/slice?orientation=axial&scrollTo=.3</a><br>
      <a href='./slicer/slice?orientation=axial&scrollTo=.6'>slicer/slice?orientation=axial&scrollTo=.6</a><br>
    </li>

    <li>
      <h3>3D Views</h3>
      <p>Displays the current contents of a 3D view window.</p>
      <a href='./slicer/threeD'>slicer/threeD</a><br>
      <a href='./slicer/threeD?lookFromAxis=left'>slicer/threeD?lookFromAxis=left</a><br>
      <a href='./slicer/threeD?lookFromAxis=anterior'>slicer/threeD?lookFromAxis=anterior</a><br>
      <a href='./slicer/threeD?lookFromAxis=inferior'>slicer/threeD?lookFromAxis=inferior</a><br>
    </li>
  </ul>

  <h2>DICOMweb</h2>

  If "DICOMweb API" option is enabled in the Web Server module then the content of the Slicer DICOM database is exposed via DICOMweb protocol.

  <ul>
    <li>
      <h3>Remote DICOM database browser</h3>
      <p>Allow remote browsing and viewing of images stored in the Slicer DICOM database using <a href="https://ohif.org/">OHIF</a>.</p>
      <h3><a href='./browse'>DICOM database browser</a></h3>
    </li>
  </ul>

  <ul>
    <li>
      <h3>Studies</h3>
      <p>Get list of all studies.</p>
      <a href='./dicom/studies'>dicom/studies</a><br>
    </li>
    <li>
      <h3>Series</h3>
      <p>Get series for a selected study. Replace "1.2.840..." with the actual Study Instance UID. This can be obtained from the study list response: it is stored under the "0020000D" key.</p>
      <a href='./dicom/studies/1.2.840.113619.2.379.176156465722799.2705.1648495543276.8/series'>dicom/studies/1.2.840.113619.2.379.176156465722799.2705.1648495543276.8/series</a><br>
    </li>
  </ul>

  <h2>Performance Tests</h2>

  <ul>
    <li>
      <h3>Time Image</h3>
      <p>Displays an image dynamically generated by the SlicerWeb server as a rendering of the current system time down
        to 100ths of a second. A new image is generate each time the page is refreshed.</p>
      <a href='./slicer/timeimage'>slicer/timeimage</a>
      <br>
      <a href='./slicer/timeimage?color=ff0'>slicer/timeimage?color=ff0</a>
      <br>
    </li>

    <li>
      <h3>Time Cube</h3>
      <p>Uses the Time Image url as the source for a texture map on a WebGL cube (only works on browsers where WebGL is
        supported). A random color is passed from the client to the server each frame and is used to render the border.
        This test is useful to see the response rate for round-trip accesses of the server.
      <p>
        <a href='./ServerTests/timecube.html'>ServerTests/timecube.html</a><br>
    </li>
  </ul>

  <h2>Rendering Tests</h2>

  <ul>
    <li>
      <a href='./ServerTests/threeDCube.html'>
        <h3>WebGL Slicer ThreeD View Cube</h3>
      </a>
      <p>Spinning cube with dynamic texture of rendered scene fetched from slicer</p>
    </li>
  </ul>

  <ul>
    <li>
      <a href='./ServerTests/threejs.html'>
        <h3>ThreeJS example</h3>
      </a>
      <p>Example of using Slicer data with Three JS.</p>
      <p>This example uses the /slicer/threeDGraphics endpoint to get a glTF representation of the threeD view.  If you have a segmentations or models in Slicer it will load your current threeD view, otherwise it will download a scene with sample models.</p>
      <p>The data is loaded in <a href='https://threejs.org'>threejs</a> demo scene letting you play with a glowing neon light like rendering of your scene.  This experiment shows an option for highlighting selected objects in a complex 3D scene.  Random models will be highlighted and you can toggle them by clicking.  The neon light effect is one of a wide array of different rendering options available in threejs.</p>
      <p>The javascript source code for this demo shows how to access the threeDGraphics endpoint and how to populate the mrml scene using the exec endpoint to send python code from javascript.</p>

      <p>Depending on scene complexity this may take a few moments to load.</p>
    </li>
  </ul>

  <ul>
    <li>
      <a href='./ServerTests/modelviewer.html'>
        <h3>modelviewer example</h3>
      </a>
      <p>Example of using Slicer data with Google's modelviewer web component for web and XR.</p>
      <p>This example uses the /slicer/threeDGraphics endpoint to get a glTF representation of the threeD view.  If you have a segmentations or models in Slicer it will load your current threeD view, otherwise it will download a scene with sample models.</p>
      <p>The data is loaded in <a href='https://modelviewer.dev'>modelviewer</a> demo scene.  </p>
      <p>The javascript source code for this demo shows how to access the threeDGraphics endpoint and how to populate the mrml scene using the exec endpoint to send python code from javascript.</p>

      <p>Depending on scene complexity this may take a few moments to load.</p>
    </li>
  </ul>

  <ul>
    <li>
      <h3>VolView examples</h3>
      <p>Load a volume in Slicer to see it in VolView.</p>
      <p>Be sure the slicer api and cors are enabled.</p>
      <p><a href='https://kitware.github.io/volview/'>volview from kitware</a> can load data from slicer directly using a <a href='https://kitware.github.io/volview/doc/loading_data.html#loading-remote-data-via-urls'>url parameter<a>.</p>
      <a href='https://volview.netlify.app/?names=%5bSlicerVolume.nrrd%5d&urls=%5bhttp://localhost:2016/slicer/volume%5d'>https://volview.netlify.app/?names=%5bmrhead.nrrd%5d&urls=%5bhttp://localhost:2016/slicer/volume%5d</a><br>
      <!--
        todo: not all features of dicomweb are currently supported so this link doesn't work yet.
          https://volview.netlify.app/?dicomweb=http://localhost:2016/dicom
      -->
    </li>
  </ul>

  <ul>
      <li>
        <h3>WebXR controller</h3>
        <p><b>Requires https and a compatible device.</b>  Setting up https currently requires editing the source code of this module to specify certificate and key files.  Compatible devices include Android phones from about 2022 or later.</p>
        <p>See <a href='https://projectweek.na-mic.org/PW40_2024_GranCanaria/Projects/AugmentedRealityExperimentsForCardiologyImaging/'>this page from Project Week 40</a> for more background.</p>
        <p>Uses <a href='https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API'>WebXR</a> to interact with Slicer scene.</p>
        <a href='./ServerTests/WebXR-controller/index.html'>WebXR-controller</a> (requires WebXR browser and https cert enabled)<br>
      </li>
  </ul>

</body>

</html>
